package java0710test05;

public class Apple extends Fruit {

	//苹果数量
	static int countApple = 0;
	
	/**
	 * 苹果的构造方法 
	 */
	public Apple() {
		
		countApple++;
		//定义了水果总数变量没法用
		//count++;
	}
	
	/**
	 * 获取苹果的数量
	 * @return
	 */
	public static int getCountApple() {
		return countApple;
		
	}

	@Override
	public Fruit fetchfruit() {
		// 摘苹果的方法
		Fruit fruit = new Apple();
		System.out.println("创建了一个苹果类的对象");
		return fruit;
	}
	
	
	
}
